package burp;


import java.net.URL;

/**
 * Created by td on 2017/6/28.
 */
public class ScanIssue implements IScanIssue {
    private IHttpRequestResponse baseHttpRequestResponse;

    private IBurpExtenderCallbacks callbacks;

    private IHttpRequestResponse[] httpRequestResponses;

    private String severity;

    private String detail;

    private String name;

    private String payload;

    public ScanIssue(IHttpRequestResponse baseHttpRequestResponse, IBurpExtenderCallbacks callbacks,
                     String severity,
                     String detail,
                     String name,
                     String payload) {
        this.baseHttpRequestResponse = baseHttpRequestResponse;
        this.callbacks = callbacks;
        this.severity = severity;
        this.detail = detail;
        this.name = name;
        this.payload = payload;
    }

    public URL getUrl() {
        IRequestInfo iRequestInfo = this.callbacks.getHelpers().analyzeRequest(baseHttpRequestResponse.getResponse());

        return iRequestInfo.getUrl();
    }

    public String getIssueName() {
        return name;
    }

    public int getIssueType() {
        return 0;
    }

    public String getSeverity() {
        return severity;
    }

    public String getConfidence() {
        return "Certain";
    }

    public String getIssueBackground() {
        return null;
    }

    public String getRemediationBackground() {
        return null;
    }

    public String getIssueDetail() {
        return detail;
    }

    public String getRemediationDetail() {
        return null;
    }

    public IHttpRequestResponse[] getHttpMessages() {
        return httpRequestResponses;
    }

    public IHttpService getHttpService() {
        return baseHttpRequestResponse.getHttpService();
    }

    public String getPayload() {
        return payload;
    }

    public void setPayload(String payload) {
        this.payload = payload;
    }
}
